//
//  CYCycleCell.m
//  CaiYun
//
//  Created by 今日信息科技 on 2017/7/12.
//  Copyright © 2017年 今日信息科技. All rights reserved.
//

#import "CYCycleCell.h"
@interface CYCycleCell()
@property (nonatomic, strong) CYImageView *imageview;
@end
@implementation CYCycleCell

- (void)setImageName:(NSString *)imageName{
    if (_imageName!=imageName)
        _imageName = imageName;
    self.imageview.hidden = NO;
    [CYHttps loadingWithFile:imageName complete:^(id data) {
        _imageview.loadingView.hidden = YES;
        _imageview.image = data;
    }];
}

- (CYImageView *)imageview{
    if (!_imageview) {
        _imageview = [[CYImageView alloc]initWithImage:nil];
        _imageview.bounds = self.bounds;
        _imageview.loadingView.hidden = NO;
        [self addSubview:_imageview];
        
        [_imageview mas_makeConstraints:^(MASConstraintMaker *make) {
            make.edges.mas_offset(UIEdgeInsetsMake(0, 0, 0, 0));
        }];
    }
    return _imageview;
}
@end
